﻿Public Class Form1
    Dim mysql_pass As String
    Dim ip_connect As String
    Dim user_namedb As String
    Dim db_name As String


    Private Sub btnadd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnadd.Click
        Dim NextForm As add = New add(mysql_pass, ip_connect, user_namedb, db_name)
        '  Dim NextForm As main_user = New main_user()
        Me.Hide()
        NextForm.ShowDialog()
    End Sub

    ' Private Sub btnshow_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnshow.Click
    ' Dim NextForm As Editdevice = New Editdevice(mysql_pass, ip_connect, user_namedb, db_name)
    '  Dim NextForm As main_user = New main_user()
    'NextForm.Show()
    'Me.Hide()
    ' End Sub

    Private Sub btnedit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnedit.Click
        Dim NextForm As Edit2 = New Edit2(mysql_pass, ip_connect, user_namedb, db_name)
        '  Dim NextForm As main_user = New main_user()
        NextForm.Show()
        Me.Hide()
    End Sub

    Private Sub btnsavehistory_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnsavehistory.Click
        Dim NextForm As historydetail = New historydetail(mysql_pass, ip_connect, user_namedb, db_name)
        '  Dim NextForm As main_user = New main_user()
        NextForm.Show()
        Me.Hide()
    End Sub

    Private Sub btnadddp_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnadddp.Click
        Dim NextForm As Adddepartment = New Adddepartment(mysql_pass, ip_connect, user_namedb, db_name)
        '  Dim NextForm As main_user = New main_user()
        NextForm.Show()
        Me.Hide()
    End Sub

    Private Sub btnbook_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnbook.Click
        Dim NextForm As device_department = New device_department(mysql_pass, ip_connect, user_namedb, db_name)
        '  Dim NextForm As main_user = New main_user()
        NextForm.Show()
        Me.Hide()
    End Sub
    Private Sub btnbookgroup_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnbookgroup.Click
        Dim NextForm As add_department_group = New add_department_group(mysql_pass, ip_connect, user_namedb, db_name)
        '  Dim NextForm As main_user = New main_user()
        NextForm.Show()
        Me.Hide()
    End Sub

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

        'mysql_pass = "stomsite"
        ip_connect = "192.168.10.23"
        '  ip_connect = "119.59.99.151"

        ' user_namedb = "tmcport_shipping"
        db_name = "it_rajyindee"

        '  ip_connect = "127.0.0.1"
        mysql_pass = "software"
        user_namedb = "root"
        ' db_name = "tmc_shpipping"

    End Sub

    Private Sub เพมขอมลอปกรณToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles เพมขอมลอปกรณToolStripMenuItem.Click
        Dim NextForm As add = New add(mysql_pass, ip_connect, user_namedb, db_name)
        '  Dim NextForm As main_user = New main_user()
        Me.Hide()
        NextForm.ShowDialog()

    End Sub

    ' Private Sub แสดงขอมลอปกรณToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles แสดงขอมลอปกรณToolStripMenuItem.Click
    ''  Dim NextForm As Editdevice = New Editdevice(mysql_pass, ip_connect, user_namedb, db_name)
    '  Dim NextForm As main_user = New main_user()
    ''  NextForm.Show()
    ''  Me.Hide()
    ''End Sub

    Private Sub แกไขขอมลอปกรToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles แกไขขอมลอปกรToolStripMenuItem.Click
        Dim NextForm As Edit2 = New Edit2(mysql_pass, ip_connect, user_namedb, db_name)
        '  Dim NextForm As main_user = New main_user()
        NextForm.Show()
        Me.Hide()
    End Sub

    Private Sub บนทกประวตบำรงรกษาToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles บนทกประวตบำรงรกษาToolStripMenuItem.Click
        Dim NextForm As historydetail = New historydetail(mysql_pass, ip_connect, user_namedb, db_name)
        '  Dim NextForm As main_user = New main_user()
        NextForm.Show()
        Me.Hide()
    End Sub

    Private Sub เพมแผนกToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles เพมแผนกToolStripMenuItem.Click
        Dim NextForm As Adddepartment = New Adddepartment(mysql_pass, ip_connect, user_namedb, db_name)
        '  Dim NextForm As main_user = New main_user()
        NextForm.Show()
        Me.Hide()
    End Sub

    Private Sub จองอปกรณToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles จองอปกรณToolStripMenuItem.Click
        Dim NextForm As device_department = New device_department(mysql_pass, ip_connect, user_namedb, db_name)
        '  Dim NextForm As main_user = New main_user()
        NextForm.Show()
        Me.Hide()
    End Sub

    Private Sub จองอปกรณกลมToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles จองอปกรณกลมToolStripMenuItem.Click
        Dim NextForm As add_department_group = New add_department_group(mysql_pass, ip_connect, user_namedb, db_name)
        '  Dim NextForm As main_user = New main_user()
        NextForm.Show()
        Me.Hide()
    End Sub

    Private Sub btneditdp_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btneditdp.Click
        Dim NextForm As showdetail = New showdetail(mysql_pass, ip_connect, user_namedb, db_name)
        '  Dim NextForm As main_user = New main_user()
        NextForm.Show()
        Me.Hide()
    End Sub

    Private Sub แกไขแผนกToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles แกไขแผนกToolStripMenuItem.Click
        Dim NextForm As showdetail = New showdetail(mysql_pass, ip_connect, user_namedb, db_name)
        '  Dim NextForm As main_user = New main_user()
        NextForm.Show()
        Me.Hide()
    End Sub

    Private Sub btnaddhis_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnaddhis.Click
        Dim NextForm As addhistory = New addhistory(mysql_pass, ip_connect, user_namedb, db_name)
        '  Dim NextForm As main_user = New main_user()
        NextForm.Show()
        Me.Hide()
    End Sub

    Private Sub btnhelpdesk_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnhelpdesk.Click
        Dim NextForm As helpdesk = New helpdesk(mysql_pass, ip_connect, user_namedb, db_name)
        '  Dim NextForm As main_user = New main_user()
        NextForm.Show()
        Me.Hide()
    End Sub

    Private Sub ประวตบำรงรกษาToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ประวตบำรงรกษาToolStripMenuItem.Click
        Dim NextForm As addhistory = New addhistory(mysql_pass, ip_connect, user_namedb, db_name)
        '  Dim NextForm As main_user = New main_user()
        NextForm.Show()
        Me.Hide()
    End Sub

    Private Sub HelpdeskToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles HelpdeskToolStripMenuItem.Click
        Dim NextForm As helpdesk = New helpdesk(mysql_pass, ip_connect, user_namedb, db_name)
        '  Dim NextForm As main_user = New main_user()
        NextForm.Show()
        Me.Hide()
    End Sub

    Private Sub btntest_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btntest.Click
        Dim NextForm As Manual = New Manual(mysql_pass, ip_connect, user_namedb, db_name)
        '  Dim NextForm As main_user = New main_user()
        NextForm.Show()
        Me.Hide()
    End Sub
End Class